<template>
<view>{{isLogin}}</view>dsfd
</template>

<script setup lang="ts">

import {useAiStore} from "@/store/ai";
import {storeToRefs} from "pinia";
import {onMounted} from "vue";

const aiStore =useAiStore()
const {userInfo,isLogin} =storeToRefs(aiStore)

onMounted(()=>{
    console.log(userInfo.value)
  if(isLogin.value){
      console.log('已经登录')
    uni.redirectTo({
      url: '/pages/ai/chat/index'
    })
  }else{
    uni.redirectTo({
      url: '/pages/ai/auth/index'
    })
  }

})

</script>

<style scoped>

</style>